<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Sifteo SDK: video.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-style-overrides.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<center>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Sifteo SDK" src="sdk_logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">
   &#160;<span id="projectnumber">v1.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</center>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li><a href="pages.html"><span>Guides</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_12cda917fe1d7c8b4e7d2501bb3636e4.html">sdk</a></li><li class="navelem"><a class="el" href="dir_2f23e30b638d6a5f333babd9a5d183e1.html">include</a></li><li class="navelem"><a class="el" href="dir_d5ace589187da7c83c1a7507ec9fbbef.html">sifteo</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">video.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/* -*- mode: C; c-basic-offset: 4; intent-tabs-mode: nil -*-</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * This file is part of the public interface to the Sifteo SDK.</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Copyright &lt;c&gt; 2012 Sifteo, Inc. All rights reserved.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#ifdef NOT_USERSPACE</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#   error This is a userspace-only header, not allowed by the current build.</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;sifteo/abi.h&gt;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;sifteo/cube.h&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;sifteo/math.h&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;sifteo/video/color.h&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &lt;sifteo/video/sprite.h&gt;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &lt;sifteo/video/framebuffer.h&gt;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &lt;sifteo/video/bg0rom.h&gt;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;sifteo/video/bg0.h&gt;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;sifteo/video/bg1.h&gt;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &lt;sifteo/video/bg2.h&gt;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#include &lt;sifteo/video/tilebuffer.h&gt;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="keyword">namespace </span>Sifteo {</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> LCD_width = 128;   </div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> LCD_height = 128;  </div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> TILE = 8;          </div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="group__math.html#ga4aa5e1c76d3adebd72a73a7051ad1fe0" title="Typedef for a 2-vector of ints.">Int2</a> LCD_size = { LCD_width, LCD_height };</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="group__math.html#ga4aa5e1c76d3adebd72a73a7051ad1fe0" title="Typedef for a 2-vector of ints.">Int2</a> LCD_center = { LCD_width / 2, LCD_height / 2 };</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="code" href="group__video.html#ga2e2ba8d4e602cffb8a6e9fc283b18b2f">   60</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="group__video.html#ga2e2ba8d4e602cffb8a6e9fc283b18b2f" title="Supported video modes.">VideoMode</a> {</div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fa56e1a5d40bf2d298e517b42de823b475">   61</a></span>&#160;    <a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fa56e1a5d40bf2d298e517b42de823b475" title="Power saving mode, LCD is off.">POWERDOWN_MODE</a> = _SYS_VM_POWERDOWN,   </div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fa2b86cc806e7d3e93a3f17eacd995287f">   62</a></span>&#160;    <a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fa2b86cc806e7d3e93a3f17eacd995287f" title="BG0, with tile data from internal ROM.">BG0_ROM</a>        = _SYS_VM_BG0_ROM,     </div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2faf6683589ce73a10099bb49fe05c7ee52">   63</a></span>&#160;    <a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2faf6683589ce73a10099bb49fe05c7ee52" title="Solid color, from colormap[0].">SOLID_MODE</a>     = _SYS_VM_SOLID,       </div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fac45945234807d796ed2a001790219b30">   64</a></span>&#160;    <a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fac45945234807d796ed2a001790219b30" title="32x32 pixel 16-color framebuffer">FB32</a>           = _SYS_VM_FB32,        </div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fa6d7c42b1f3be3191ed800cbf9e9207e2">   65</a></span>&#160;    <a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fa6d7c42b1f3be3191ed800cbf9e9207e2" title="64x64 pixel 2-color framebuffer">FB64</a>           = _SYS_VM_FB64,        </div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fa20d5397739678db8638bfa34bb4fa349">   66</a></span>&#160;    <a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fa20d5397739678db8638bfa34bb4fa349" title="128x48 pixel 2-color framebuffer">FB128</a>          = _SYS_VM_FB128,       </div>
<div class="line"><a name="l00067"></a><span class="lineno"><a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fad7d51211625ebf0e2ec29cf9517ba386">   67</a></span>&#160;    <a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fad7d51211625ebf0e2ec29cf9517ba386" title="BG0 background layer.">BG0</a>            = _SYS_VM_BG0,         </div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fa3c6dfc2185641139e06a9175a9659506">   68</a></span>&#160;    <a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fa3c6dfc2185641139e06a9175a9659506" title="BG0 background plus BG1 overlay.">BG0_BG1</a>        = _SYS_VM_BG0_BG1,     </div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fa5ac60fa49c6d6ae0083bcf5532ec8f33">   69</a></span>&#160;    <a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fa5ac60fa49c6d6ae0083bcf5532ec8f33" title="BG0 background, 8 sprites, BG1 overlay.">BG0_SPR_BG1</a>    = _SYS_VM_BG0_SPR_BG1, </div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2faae2d0650403ba3b1ed40fd1a48ed31f5">   70</a></span>&#160;    <a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2faae2d0650403ba3b1ed40fd1a48ed31f5" title="16x16 tiled mode with affine transform">BG2</a>            = _SYS_VM_BG2,         </div>
<div class="line"><a name="l00071"></a><span class="lineno"><a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fac58aef3d925f559c52c260b58ef062a0">   71</a></span>&#160;    <a class="code" href="group__video.html#gga2e2ba8d4e602cffb8a6e9fc283b18b2fac58aef3d925f559c52c260b58ef062a0" title="Reconfigurable 16-color framebuffer with transparency.">STAMP</a>          = _SYS_VM_STAMP,       </div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;};</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="code" href="group__video.html#gaa8d0a28cd88f048fe9e21f8f3cc4abf7">   84</a></span>&#160;<span class="keyword">enum</span> <a class="code" href="group__video.html#gaa8d0a28cd88f048fe9e21f8f3cc4abf7" title="Rotation and mirroring modes, for setRotation().">Rotation</a> {</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    ROT_NORMAL              = 0,</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    ROT_LEFT_90_MIRROR      = _SYS_VF_XY_SWAP,</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    ROT_MIRROR              = _SYS_VF_X_FLIP,</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    ROT_LEFT_90             = _SYS_VF_XY_SWAP | _SYS_VF_Y_FLIP,</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    ROT_180_MIRROR          = _SYS_VF_Y_FLIP,</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    ROT_RIGHT_90            = _SYS_VF_XY_SWAP | _SYS_VF_X_FLIP,</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    ROT_180                 = _SYS_VF_X_FLIP | _SYS_VF_Y_FLIP,</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    ROT_RIGHT_90_MIRROR     = _SYS_VF_XY_SWAP | _SYS_VF_X_FLIP | _SYS_VF_Y_FLIP</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;};</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div>
<div class="line"><a name="l00126"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html">  126</a></span>&#160;<span class="keyword">struct </span><a class="code" href="struct_sifteo_1_1_video_buffer.html" title="A memory buffer which holds graphics data.">VideoBuffer</a> {</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <span class="keyword">union </span>{</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;        _SYSAttachedVideoBuffer sys;</div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a8d31ae2f17dfdd8d63608ea9dff5b3aa">  130</a></span>&#160;        <a class="code" href="struct_sifteo_1_1_sprite_layer.html" title="A SpriteLayer represents the VRAM attributes for the sprite rendering layer in BG0_SPR_BG1 mode...">SpriteLayer</a>             <a class="code" href="struct_sifteo_1_1_video_buffer.html#a8d31ae2f17dfdd8d63608ea9dff5b3aa" title="Drawable for the sprite layer in BG0_SPR_BG1 mode.">sprites</a>;    </div>
<div class="line"><a name="l00131"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#aeddcdf07a4b64c880d1044956f7f4e8e">  131</a></span>&#160;        <a class="code" href="struct_sifteo_1_1_colormap.html" title="An accessor for the colormap, with up to 16 colors.">Colormap</a>                <a class="code" href="struct_sifteo_1_1_video_buffer.html#aeddcdf07a4b64c880d1044956f7f4e8e" title="Colormap accessor, for framebuffer modes.">colormap</a>;   </div>
<div class="line"><a name="l00132"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#abc102f259cbb354b6854affdc3b89982">  132</a></span>&#160;        <a class="code" href="struct_sifteo_1_1_f_b_drawable.html">FB32Drawable</a>            <a class="code" href="struct_sifteo_1_1_video_buffer.html#abc102f259cbb354b6854affdc3b89982" title="Drawable for the FB32 framebuffer mode.">fb32</a>;       </div>
<div class="line"><a name="l00133"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a174cde1b0c08eddd197fa573b5960be0">  133</a></span>&#160;        <a class="code" href="struct_sifteo_1_1_f_b_drawable.html">FB64Drawable</a>            <a class="code" href="struct_sifteo_1_1_video_buffer.html#a174cde1b0c08eddd197fa573b5960be0" title="Drawable for the FB64 framebuffer mode.">fb64</a>;       </div>
<div class="line"><a name="l00134"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a303cae6545c344e1cd95252c4d293107">  134</a></span>&#160;        <a class="code" href="struct_sifteo_1_1_f_b_drawable.html">FB128Drawable</a>           <a class="code" href="struct_sifteo_1_1_video_buffer.html#a303cae6545c344e1cd95252c4d293107" title="Drawable for the FB128 framebuffer mode.">fb128</a>;      </div>
<div class="line"><a name="l00135"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a4c1a1eaa46813f547f7bb22c595a5c35">  135</a></span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g0_r_o_m_drawable.html" title="A VRAM accessor for drawing graphics in the BG0_ROM mode.">BG0ROMDrawable</a>          <a class="code" href="struct_sifteo_1_1_video_buffer.html#a4c1a1eaa46813f547f7bb22c595a5c35" title="Drawable for the BG0_ROM tiled mode.">bg0rom</a>;     </div>
<div class="line"><a name="l00136"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#ad0620b6a8212aa0722d7f84a05b3e191">  136</a></span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g0_drawable.html" title="A VRAM accessor for drawing graphics in the BG0 mode.">BG0Drawable</a>             <a class="code" href="struct_sifteo_1_1_video_buffer.html#ad0620b6a8212aa0722d7f84a05b3e191" title="Drawable for the BG0 layer, as used in BG0, BG0_BG1, and BG0_SPR_BG1 modes.">bg0</a>;        </div>
<div class="line"><a name="l00137"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a7efb1ac127ba63414b63d0f69aaaf4ad">  137</a></span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g1_drawable.html" title="A VRAM accessor for drawing graphics in the BG1 mode.">BG1Drawable</a>             <a class="code" href="struct_sifteo_1_1_video_buffer.html#a7efb1ac127ba63414b63d0f69aaaf4ad" title="Drawable for the BG1 layer, as used in BG0_BG1 and BG0_SPR_BG1 modes.">bg1</a>;        </div>
<div class="line"><a name="l00138"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#abf9cf11c859b81e53539fad1a1b7c3ca">  138</a></span>&#160;        <a class="code" href="struct_sifteo_1_1_b_g2_drawable.html" title="A VRAM accessor for drawing graphics in the BG2 mode.">BG2Drawable</a>             <a class="code" href="struct_sifteo_1_1_video_buffer.html#abf9cf11c859b81e53539fad1a1b7c3ca" title="Drawable for the BG2 tiled mode.">bg2</a>;        </div>
<div class="line"><a name="l00139"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a499b8a9632dfe8bbfc7cb5ce5389a3c8">  139</a></span>&#160;        <a class="code" href="struct_sifteo_1_1_stamp_drawable.html" title="A VRAM accessor for the STAMP mode, a special purpose 16-color framebuffer mode which supports color-...">StampDrawable</a>           <a class="code" href="struct_sifteo_1_1_video_buffer.html#a499b8a9632dfe8bbfc7cb5ce5389a3c8" title="Drawable for the STAMP framebuffer mode.">stamp</a>;      </div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    };</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    <span class="comment">// Implicit conversions</span></div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    <span class="keyword">operator</span> _SYSVideoBuffer* () { <span class="keywordflow">return</span> &amp;sys.vbuf; }</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> _SYSVideoBuffer* () <span class="keyword">const</span> { <span class="keywordflow">return</span> &amp;sys.vbuf; }</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    <span class="keyword">operator</span> _SYSAttachedVideoBuffer* () { <span class="keywordflow">return</span> &amp;sys; }</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <span class="keyword">operator</span> <span class="keyword">const</span> _SYSAttachedVideoBuffer* () <span class="keyword">const</span> { <span class="keywordflow">return</span> &amp;sys; }</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;</div>
<div class="line"><a name="l00155"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#aac43dc3124249835371fc0e003c64258">  155</a></span>&#160;    <span class="keyword">operator</span> _SYSCubeID ()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;        <span class="keywordflow">return</span> sys.cube;</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    }</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;</div>
<div class="line"><a name="l00162"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a77de0feaf960c89abe469a351c0c130f">  162</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_cube_i_d.html" title="A lightweight identifier for one Sifteo cube.">CubeID</a> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a77de0feaf960c89abe469a351c0c130f" title="Get the CubeID that this buffer is currently attached to.">cube</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;        <span class="keywordflow">return</span> sys.cube;</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    }</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;</div>
<div class="line"><a name="l00182"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a0c89222691487b3fc7940d85012cb01f">  182</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a0c89222691487b3fc7940d85012cb01f" title="Change the current drawing window.">setWindow</a>(uint8_t firstLine, uint8_t numLines) {</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;        <a class="code" href="struct_sifteo_1_1_video_buffer.html#a4419fb1a7322a4a771ab9a3f2a1d5ca1" title="Modify a word of VRAM, automatically locking it and marking the change only if that word has actually...">poke</a>(<a class="code" href="group__macros.html#gafef9199621fafa1bd046611921ab061f">offsetof</a>(_SYSVideoRAM, first_line) / 2, firstLine | (numLines &lt;&lt; 8));</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    }</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;</div>
<div class="line"><a name="l00189"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#ae16a958e066590c8e1ae523982046f1b">  189</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#ae16a958e066590c8e1ae523982046f1b" title="Restore the default full-screen drawing window.">setDefaultWindow</a>() {</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        <a class="code" href="struct_sifteo_1_1_video_buffer.html#a0c89222691487b3fc7940d85012cb01f" title="Change the current drawing window.">setWindow</a>(0, LCD_height);</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    }</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;</div>
<div class="line"><a name="l00196"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a72e31ae868682505238a98ef86fc6849">  196</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a72e31ae868682505238a98ef86fc6849" title="Like setWindow(), but change only the first line.">setWindowFirstLine</a>(uint8_t firstLine) {</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;        <a class="code" href="struct_sifteo_1_1_video_buffer.html#a21e9698e8258a3dbbe924c4b86853ad3" title="Like poke(), but modifies a single byte. Less efficient, but sometimes you really do just want to mod...">pokeb</a>(<a class="code" href="group__macros.html#gafef9199621fafa1bd046611921ab061f">offsetof</a>(_SYSVideoRAM, first_line), firstLine);</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    }</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;</div>
<div class="line"><a name="l00203"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a6763d365d7fbf71040adb9e77479fe93">  203</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a6763d365d7fbf71040adb9e77479fe93" title="Like setWindow(), but change only the number of lines.">setWindowNumLines</a>(uint8_t numLines) {</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;        <a class="code" href="struct_sifteo_1_1_video_buffer.html#a21e9698e8258a3dbbe924c4b86853ad3" title="Like poke(), but modifies a single byte. Less efficient, but sometimes you really do just want to mod...">pokeb</a>(<a class="code" href="group__macros.html#gafef9199621fafa1bd046611921ab061f">offsetof</a>(_SYSVideoRAM, num_lines), numLines);</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;    }</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    </div>
<div class="line"><a name="l00211"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a7f81210128f8f6e21460a0d7c0582681">  211</a></span>&#160;    uint8_t <a class="code" href="struct_sifteo_1_1_video_buffer.html#a7f81210128f8f6e21460a0d7c0582681" title="Retrieve the most recent &#39;firstLine&#39; value, set with setWindow() or setWindowFirstLine()">windowFirstLine</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a97bdd2f4e61c319f7ddb1479032e36ec" title="Read one byte of VRAM.">peekb</a>(<a class="code" href="group__macros.html#gafef9199621fafa1bd046611921ab061f">offsetof</a>(_SYSVideoRAM, first_line));</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    }</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;</div>
<div class="line"><a name="l00219"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a67c8f736b7cab1d4699a5fda16f02c48">  219</a></span>&#160;    uint8_t <a class="code" href="struct_sifteo_1_1_video_buffer.html#a67c8f736b7cab1d4699a5fda16f02c48" title="Retrieve the most recent &#39;numLines&#39; value, set with setWindow() or setWindowNumLines()">windowNumLines</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a97bdd2f4e61c319f7ddb1479032e36ec" title="Read one byte of VRAM.">peekb</a>(<a class="code" href="group__macros.html#gafef9199621fafa1bd046611921ab061f">offsetof</a>(_SYSVideoRAM, num_lines));</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    }</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;</div>
<div class="line"><a name="l00226"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a6b37adf80404991354f3b7a1be669000">  226</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a6b37adf80404991354f3b7a1be669000" title="Set the display rotation to use in subsequent rendering.">setRotation</a>(<a class="code" href="group__video.html#gaa8d0a28cd88f048fe9e21f8f3cc4abf7" title="Rotation and mirroring modes, for setRotation().">Rotation</a> r) {</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;        <span class="keyword">const</span> uint8_t mask = _SYS_VF_XY_SWAP | _SYS_VF_X_FLIP | _SYS_VF_Y_FLIP;</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;        uint8_t flags = <a class="code" href="struct_sifteo_1_1_video_buffer.html#a97bdd2f4e61c319f7ddb1479032e36ec" title="Read one byte of VRAM.">peekb</a>(<a class="code" href="group__macros.html#gafef9199621fafa1bd046611921ab061f">offsetof</a>(_SYSVideoRAM, flags));</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;        <span class="comment">// Must do this atomically; the asynchronous paint controller can</span></div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;        <span class="comment">// modify other bits within this flags byte.</span></div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;        <a class="code" href="struct_sifteo_1_1_video_buffer.html#ab3c23e1d8eefdde108d281ec19aebfe3" title="Like pokeb(), but atomically XORs a value with the byte. This is a no-op if and only if byte==0...">xorb</a>(<a class="code" href="group__macros.html#gafef9199621fafa1bd046611921ab061f">offsetof</a>(_SYSVideoRAM, flags), (r ^ flags) &amp; mask);</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    }</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;</div>
<div class="line"><a name="l00238"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#af16b712a97a7e5ae8f8f308230e5cfbe">  238</a></span>&#160;    <a class="code" href="group__video.html#gaa8d0a28cd88f048fe9e21f8f3cc4abf7" title="Rotation and mirroring modes, for setRotation().">Rotation</a> <a class="code" href="struct_sifteo_1_1_video_buffer.html#af16b712a97a7e5ae8f8f308230e5cfbe" title="Look up the last display rotation set by setRotation().">rotation</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;        <span class="keyword">const</span> uint8_t mask = _SYS_VF_XY_SWAP | _SYS_VF_X_FLIP | _SYS_VF_Y_FLIP;</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;        uint8_t flags = <a class="code" href="struct_sifteo_1_1_video_buffer.html#a97bdd2f4e61c319f7ddb1479032e36ec" title="Read one byte of VRAM.">peekb</a>(<a class="code" href="group__macros.html#gafef9199621fafa1bd046611921ab061f">offsetof</a>(_SYSVideoRAM, flags));</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group__video.html#gaa8d0a28cd88f048fe9e21f8f3cc4abf7" title="Rotation and mirroring modes, for setRotation().">Rotation</a>(mask &amp; flags);</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    }</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;</div>
<div class="line"><a name="l00248"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#aaaff2df000e80effede43f717f8cc06b">  248</a></span>&#160;    <a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a> <a class="code" href="struct_sifteo_1_1_video_buffer.html#aaaff2df000e80effede43f717f8cc06b" title="Map the LCD rotation mask to screen orientation. This is the side which maps to the physical &quot;top&quot; of...">orientation</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;        <span class="keywordflow">switch</span> (<a class="code" href="struct_sifteo_1_1_video_buffer.html#af16b712a97a7e5ae8f8f308230e5cfbe" title="Look up the last display rotation set by setRotation().">rotation</a>()) {</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;            <span class="keywordflow">case</span> ROT_NORMAL:    <span class="keywordflow">return</span> <a class="code" href="group__cube.html#gga8dc17340f515227e9bb34532bfc2fef3aa7e252d70c0048985f2a0e5be572dfb0" title="Top side (Y-)">TOP</a>;</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;            <span class="keywordflow">case</span> ROT_LEFT_90:   <span class="keywordflow">return</span> <a class="code" href="group__cube.html#gga8dc17340f515227e9bb34532bfc2fef3a0cdc44fae1a8ecdb1155e0cc55db46a9" title="Left side (X-)">LEFT</a>;</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;            <span class="keywordflow">case</span> ROT_180:       <span class="keywordflow">return</span> <a class="code" href="group__cube.html#gga8dc17340f515227e9bb34532bfc2fef3adbddf65002d96370660e58b1141516b8" title="Bottom side (Y+)">BOTTOM</a>;</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;            <span class="keywordflow">case</span> ROT_RIGHT_90:  <span class="keywordflow">return</span> <a class="code" href="group__cube.html#gga8dc17340f515227e9bb34532bfc2fef3a059aa70ec021f7afb1510be19083172d" title="Right side (X+)">RIGHT</a>;</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;            <span class="keywordflow">default</span>:            <span class="keywordflow">return</span> <a class="code" href="group__cube.html#gga8dc17340f515227e9bb34532bfc2fef3a907c90c21486c90c851379c9dd79b1b8" title="Nil value (-1)">NO_SIDE</a>;</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;        }</div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;    }</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;</div>
<div class="line"><a name="l00264"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a5ba976d3850fc1c7b60c32d0d9a63920">  264</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a5ba976d3850fc1c7b60c32d0d9a63920" title="Set the LCD rotation such that the top of the framebuffer is at the physical side &#39;topSide&#39;...">setOrientation</a>(<a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a> topSide) {</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;        <span class="comment">// Tiny lookup table in a uint32</span></div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;        <span class="keyword">const</span> uint32_t sideToRotation =</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;            (ROT_NORMAL     &lt;&lt; 0)  |</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;            (ROT_LEFT_90    &lt;&lt; 8)  |</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;            (ROT_180        &lt;&lt; 16) |</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;            (ROT_RIGHT_90   &lt;&lt; 24) ;</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(topSide &gt;= 0 &amp;&amp; topSide &lt; 4);</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;        uint8_t r = sideToRotation &gt;&gt; (topSide * 8);</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;        <a class="code" href="struct_sifteo_1_1_video_buffer.html#a6b37adf80404991354f3b7a1be669000" title="Set the display rotation to use in subsequent rendering.">setRotation</a>(<a class="code" href="group__video.html#gaa8d0a28cd88f048fe9e21f8f3cc4abf7" title="Rotation and mirroring modes, for setRotation().">Rotation</a>(r));</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;    }</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;</div>
<div class="line"><a name="l00290"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#ae775489a1fbc1ba9bf8a20385f56aacb">  290</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#ae775489a1fbc1ba9bf8a20385f56aacb" title="Set this VideoBuffer&#39;s cube orientation to be consistent with the orientation of another &quot;source&quot; Vid...">orientTo</a>(<span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a> &amp;thisN, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html" title="A memory buffer which holds graphics data.">VideoBuffer</a> &amp;src, <span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a> &amp;srcN) {</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;        <span class="keywordtype">int</span> srcSide = srcN.<a class="code" href="struct_sifteo_1_1_neighborhood.html#ae2ca173acc8f80b33c17aa077493297d" title="Search for a CubeID in this Neighborhood.">sideOf</a>(<a class="code" href="struct_sifteo_1_1_video_buffer.html#a77de0feaf960c89abe469a351c0c130f" title="Get the CubeID that this buffer is currently attached to.">cube</a>());</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;        <span class="keywordtype">int</span> dstSide = thisN.<a class="code" href="struct_sifteo_1_1_neighborhood.html#ae2ca173acc8f80b33c17aa077493297d" title="Search for a CubeID in this Neighborhood.">sideOf</a>(src.<a class="code" href="struct_sifteo_1_1_video_buffer.html#a77de0feaf960c89abe469a351c0c130f" title="Get the CubeID that this buffer is currently attached to.">cube</a>());</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;        <span class="keywordflow">if</span>(srcSide != <a class="code" href="group__cube.html#gga8dc17340f515227e9bb34532bfc2fef3a907c90c21486c90c851379c9dd79b1b8" title="Nil value (-1)">NO_SIDE</a> &amp;&amp; dstSide != <a class="code" href="group__cube.html#gga8dc17340f515227e9bb34532bfc2fef3a907c90c21486c90c851379c9dd79b1b8" title="Nil value (-1)">NO_SIDE</a>) {</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;            <a class="code" href="struct_sifteo_1_1_video_buffer.html#a5ba976d3850fc1c7b60c32d0d9a63920" title="Set the LCD rotation such that the top of the framebuffer is at the physical side &#39;topSide&#39;...">setOrientation</a>(<a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a>(<a class="code" href="group__math.html#gacd70c1d896652ae6cd08793202b929bf" title="Compute the unsigned remainder from dividing two signed integers.">umod</a>(2 + dstSide - srcSide + src.<a class="code" href="struct_sifteo_1_1_video_buffer.html#aaaff2df000e80effede43f717f8cc06b" title="Map the LCD rotation mask to screen orientation. This is the side which maps to the physical &quot;top&quot; of...">orientation</a>(), <a class="code" href="group__cube.html#gga8dc17340f515227e9bb34532bfc2fef3acfd3767ac3e69432b6a0bd7106c35f4e" title="Total number of sides (4)">NUM_SIDES</a>)));</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;        }</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;        </div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;    }</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;</div>
<div class="line"><a name="l00308"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a59ea1235ca2be45cc4a37a0cefc7b39d">  308</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a59ea1235ca2be45cc4a37a0cefc7b39d" title="Variant of orientTo() without explicitly specified Neighborhoods.">orientTo</a>(<span class="keyword">const</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html" title="A memory buffer which holds graphics data.">VideoBuffer</a> &amp;src) {</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;        <a class="code" href="struct_sifteo_1_1_video_buffer.html#ae775489a1fbc1ba9bf8a20385f56aacb" title="Set this VideoBuffer&#39;s cube orientation to be consistent with the orientation of another &quot;source&quot; Vid...">orientTo</a>(<a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a>(<a class="code" href="struct_sifteo_1_1_video_buffer.html#a77de0feaf960c89abe469a351c0c130f" title="Get the CubeID that this buffer is currently attached to.">cube</a>()), src, <a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a>(src.<a class="code" href="struct_sifteo_1_1_video_buffer.html#a77de0feaf960c89abe469a351c0c130f" title="Get the CubeID that this buffer is currently attached to.">cube</a>()));</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;    }</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;</div>
<div class="line"><a name="l00316"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a53861e8b4a906c1d53864124e63a9f88">  316</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a53861e8b4a906c1d53864124e63a9f88" title="Convert a physical side (relative to the hardware itself) to a virtual side (relative to the specifie...">physicalToVirtual</a>(<a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a> side, <a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a> rot) {</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;        <span class="keywordflow">if</span> (side == <a class="code" href="group__cube.html#gga8dc17340f515227e9bb34532bfc2fef3a907c90c21486c90c851379c9dd79b1b8" title="Nil value (-1)">NO_SIDE</a>) { <span class="keywordflow">return</span> <a class="code" href="group__cube.html#gga8dc17340f515227e9bb34532bfc2fef3a907c90c21486c90c851379c9dd79b1b8" title="Nil value (-1)">NO_SIDE</a>; }</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(side &gt;= 0 &amp;&amp; side &lt; 4 &amp;&amp; rot != <a class="code" href="group__cube.html#gga8dc17340f515227e9bb34532bfc2fef3a907c90c21486c90c851379c9dd79b1b8" title="Nil value (-1)">NO_SIDE</a>);</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a>(<a class="code" href="group__math.html#gacd70c1d896652ae6cd08793202b929bf" title="Compute the unsigned remainder from dividing two signed integers.">umod</a>(side - rot, <a class="code" href="group__cube.html#gga8dc17340f515227e9bb34532bfc2fef3acfd3767ac3e69432b6a0bd7106c35f4e" title="Total number of sides (4)">NUM_SIDES</a>));</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;    }</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;</div>
<div class="line"><a name="l00326"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#aef08f2ddd0ae70730333248934c7ccfa">  326</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a> <a class="code" href="struct_sifteo_1_1_video_buffer.html#aef08f2ddd0ae70730333248934c7ccfa" title="Convert a virtual side (relative to the specified screen orientation) to a physical side (relative to...">virtualToPhysical</a>(<a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a> side, <a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a> rot) {</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;        <span class="keywordflow">if</span> (side == <a class="code" href="group__cube.html#gga8dc17340f515227e9bb34532bfc2fef3a907c90c21486c90c851379c9dd79b1b8" title="Nil value (-1)">NO_SIDE</a>) { <span class="keywordflow">return</span> <a class="code" href="group__cube.html#gga8dc17340f515227e9bb34532bfc2fef3a907c90c21486c90c851379c9dd79b1b8" title="Nil value (-1)">NO_SIDE</a>; }</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;        <a class="code" href="group__macros.html#ga8a15779356736a0900a162442b1cda53" title="Runtime debug assertion.">ASSERT</a>(side &gt;= 0 &amp;&amp; side &lt; 4 &amp;&amp; rot != <a class="code" href="group__cube.html#gga8dc17340f515227e9bb34532bfc2fef3a907c90c21486c90c851379c9dd79b1b8" title="Nil value (-1)">NO_SIDE</a>);</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a>(<a class="code" href="group__math.html#gacd70c1d896652ae6cd08793202b929bf" title="Compute the unsigned remainder from dividing two signed integers.">umod</a>(side + rot, <a class="code" href="group__cube.html#gga8dc17340f515227e9bb34532bfc2fef3acfd3767ac3e69432b6a0bd7106c35f4e" title="Total number of sides (4)">NUM_SIDES</a>));</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;    }</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;</div>
<div class="line"><a name="l00336"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a4ca3896743662fca64aeb9376771d43a">  336</a></span>&#160;    <a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a4ca3896743662fca64aeb9376771d43a" title="Convert a physical side (relative to the hardware itself) to a virtual side (relative to the current ...">physicalToVirtual</a>(<a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a> side)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a53861e8b4a906c1d53864124e63a9f88" title="Convert a physical side (relative to the hardware itself) to a virtual side (relative to the specifie...">physicalToVirtual</a>(side, <a class="code" href="struct_sifteo_1_1_video_buffer.html#aaaff2df000e80effede43f717f8cc06b" title="Map the LCD rotation mask to screen orientation. This is the side which maps to the physical &quot;top&quot; of...">orientation</a>());</div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;    }</div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;</div>
<div class="line"><a name="l00344"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#aebb635bde4a92c51060e46b9dc6f9f2d">  344</a></span>&#160;    <a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a> <a class="code" href="struct_sifteo_1_1_video_buffer.html#aebb635bde4a92c51060e46b9dc6f9f2d" title="Convert a virtual side (relative to the current screen orientation) to a physical side (relative to t...">virtualToPhysical</a>(<a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a> side)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#aef08f2ddd0ae70730333248934c7ccfa" title="Convert a virtual side (relative to the specified screen orientation) to a physical side (relative to...">virtualToPhysical</a>(side, <a class="code" href="struct_sifteo_1_1_video_buffer.html#aaaff2df000e80effede43f717f8cc06b" title="Map the LCD rotation mask to screen orientation. This is the side which maps to the physical &quot;top&quot; of...">orientation</a>());</div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;    }</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;</div>
<div class="line"><a name="l00358"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a6a8a8d63b0b2576deac125d36183789c">  358</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a6a8a8d63b0b2576deac125d36183789c" title="Convert a Neighborhood from physical to virtual orientation.">physicalToVirtual</a>(<a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a> nb, <a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a> rot) {</div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;        <a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a> result;</div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;        result.sys.sides[0] = nb.sys.sides[<a class="code" href="struct_sifteo_1_1_video_buffer.html#aef08f2ddd0ae70730333248934c7ccfa" title="Convert a virtual side (relative to the specified screen orientation) to a physical side (relative to...">virtualToPhysical</a>(<a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a>(0), rot)];</div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;        result.sys.sides[1] = nb.sys.sides[<a class="code" href="struct_sifteo_1_1_video_buffer.html#aef08f2ddd0ae70730333248934c7ccfa" title="Convert a virtual side (relative to the specified screen orientation) to a physical side (relative to...">virtualToPhysical</a>(<a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a>(1), rot)];</div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;        result.sys.sides[2] = nb.sys.sides[<a class="code" href="struct_sifteo_1_1_video_buffer.html#aef08f2ddd0ae70730333248934c7ccfa" title="Convert a virtual side (relative to the specified screen orientation) to a physical side (relative to...">virtualToPhysical</a>(<a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a>(2), rot)];</div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;        result.sys.sides[3] = nb.sys.sides[<a class="code" href="struct_sifteo_1_1_video_buffer.html#aef08f2ddd0ae70730333248934c7ccfa" title="Convert a virtual side (relative to the specified screen orientation) to a physical side (relative to...">virtualToPhysical</a>(<a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a>(3), rot)];</div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;        <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;    }</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;</div>
<div class="line"><a name="l00377"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#ab5ddfc1c9b5e17ab0411a68c50473949">  377</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a> <a class="code" href="struct_sifteo_1_1_video_buffer.html#ab5ddfc1c9b5e17ab0411a68c50473949" title="Convert a Neighborhood from virtual to physical orientation.">virtualToPhysical</a>(<a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a> nb, <a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a> rot) {</div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;        <a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a> result;</div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;        result.sys.sides[0] = nb.sys.sides[<a class="code" href="struct_sifteo_1_1_video_buffer.html#a53861e8b4a906c1d53864124e63a9f88" title="Convert a physical side (relative to the hardware itself) to a virtual side (relative to the specifie...">physicalToVirtual</a>(<a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a>(0), rot)];</div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;        result.sys.sides[1] = nb.sys.sides[<a class="code" href="struct_sifteo_1_1_video_buffer.html#a53861e8b4a906c1d53864124e63a9f88" title="Convert a physical side (relative to the hardware itself) to a virtual side (relative to the specifie...">physicalToVirtual</a>(<a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a>(1), rot)];</div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;        result.sys.sides[2] = nb.sys.sides[<a class="code" href="struct_sifteo_1_1_video_buffer.html#a53861e8b4a906c1d53864124e63a9f88" title="Convert a physical side (relative to the hardware itself) to a virtual side (relative to the specifie...">physicalToVirtual</a>(<a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a>(2), rot)];</div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;        result.sys.sides[3] = nb.sys.sides[<a class="code" href="struct_sifteo_1_1_video_buffer.html#a53861e8b4a906c1d53864124e63a9f88" title="Convert a physical side (relative to the hardware itself) to a virtual side (relative to the specifie...">physicalToVirtual</a>(<a class="code" href="group__cube.html#ga8dc17340f515227e9bb34532bfc2fef3" title="An enumeration which names the four sides of a Sifteo cube.">Side</a>(3), rot)];</div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;        <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;    }</div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;</div>
<div class="line"><a name="l00396"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a4bcb8d641638bc988fbba40655b7f7c0">  396</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a4bcb8d641638bc988fbba40655b7f7c0" title="Convert a Neighborhood from physical to virtual orientation.">physicalToVirtual</a>(<a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a> nb)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a53861e8b4a906c1d53864124e63a9f88" title="Convert a physical side (relative to the hardware itself) to a virtual side (relative to the specifie...">physicalToVirtual</a>(nb, <a class="code" href="struct_sifteo_1_1_video_buffer.html#aaaff2df000e80effede43f717f8cc06b" title="Map the LCD rotation mask to screen orientation. This is the side which maps to the physical &quot;top&quot; of...">orientation</a>());</div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;    }</div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;</div>
<div class="line"><a name="l00410"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#abfa3309a1d47df7dfc6070bd73e84141">  410</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a> <a class="code" href="struct_sifteo_1_1_video_buffer.html#abfa3309a1d47df7dfc6070bd73e84141" title="Convert a Neighborhood from virtual to physical orientation.">virtualToPhysical</a>(<a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a> nb)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#aef08f2ddd0ae70730333248934c7ccfa" title="Convert a virtual side (relative to the specified screen orientation) to a physical side (relative to...">virtualToPhysical</a>(nb, <a class="code" href="struct_sifteo_1_1_video_buffer.html#aaaff2df000e80effede43f717f8cc06b" title="Map the LCD rotation mask to screen orientation. This is the side which maps to the physical &quot;top&quot; of...">orientation</a>());</div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;    }</div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;</div>
<div class="line"><a name="l00422"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#ad0dcb38ca0a929576d854ec562f26fa3">  422</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a> <a class="code" href="struct_sifteo_1_1_video_buffer.html#ad0dcb38ca0a929576d854ec562f26fa3" title="Return the current physical neighbors for the cube attached to this VideoBuffer.">physicalNeighbors</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a>(<a class="code" href="struct_sifteo_1_1_video_buffer.html#a77de0feaf960c89abe469a351c0c130f" title="Get the CubeID that this buffer is currently attached to.">cube</a>());</div>
<div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;    }</div>
<div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;</div>
<div class="line"><a name="l00433"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a94d3f67acdd18d10f0ead04b65bac66a">  433</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a94d3f67acdd18d10f0ead04b65bac66a" title="Return the current virtual neighbors for the cube attached to this VideoBuffer.">virtualNeighbors</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a53861e8b4a906c1d53864124e63a9f88" title="Convert a physical side (relative to the hardware itself) to a virtual side (relative to the specifie...">physicalToVirtual</a>(<a class="code" href="struct_sifteo_1_1_neighborhood.html" title="A Neighborhood is a description of all neighbors for a single cube, packed into a small value...">Neighborhood</a>(<a class="code" href="struct_sifteo_1_1_video_buffer.html#a77de0feaf960c89abe469a351c0c130f" title="Get the CubeID that this buffer is currently attached to.">cube</a>()));</div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;    }</div>
<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;</div>
<div class="line"><a name="l00444"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a0af3dc18ca2863f34d33082c3e2ed2a6">  444</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_vector3.html">Byte3</a> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a0af3dc18ca2863f34d33082c3e2ed2a6" title="Return the physical accelerometer reading for this cube.">physicalAccel</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a77de0feaf960c89abe469a351c0c130f" title="Get the CubeID that this buffer is currently attached to.">cube</a>().<a class="code" href="struct_sifteo_1_1_cube_i_d.html#a6da5d2ed7096f343f921b2a879c54e80" title="Return the physical accelerometer state, as a signed byte-vector.">accel</a>();</div>
<div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;    }</div>
<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;</div>
<div class="line"><a name="l00454"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#aa27f05696d41db66b4e6bf850f65b083">  454</a></span>&#160;    <a class="code" href="struct_sifteo_1_1_vector3.html">Byte3</a> <a class="code" href="struct_sifteo_1_1_video_buffer.html#aa27f05696d41db66b4e6bf850f65b083" title="Return the virtual accelerometer reading for this cube.">virtualAccel</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a77de0feaf960c89abe469a351c0c130f" title="Get the CubeID that this buffer is currently attached to.">cube</a>().<a class="code" href="struct_sifteo_1_1_cube_i_d.html#a6da5d2ed7096f343f921b2a879c54e80" title="Return the physical accelerometer state, as a signed byte-vector.">accel</a>().<a class="code" href="struct_sifteo_1_1_vector3.html#a0305e2ccb6c70308d3b5d44dbb27e862" title="Rotate this vector about the Z axis counterclockwise by an integer multiple of 90 degrees...">zRotateI</a>(<a class="code" href="struct_sifteo_1_1_video_buffer.html#aaaff2df000e80effede43f717f8cc06b" title="Map the LCD rotation mask to screen orientation. This is the side which maps to the physical &quot;top&quot; of...">orientation</a>());</div>
<div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;    }</div>
<div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;</div>
<div class="line"><a name="l00467"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a41d12aea8d7bf621e92efcfe4a622c0f">  467</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a41d12aea8d7bf621e92efcfe4a622c0f" title="Change the video mode.">setMode</a>(<a class="code" href="group__video.html#ga2e2ba8d4e602cffb8a6e9fc283b18b2f" title="Supported video modes.">VideoMode</a> m) {</div>
<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;        <a class="code" href="struct_sifteo_1_1_video_buffer.html#a21e9698e8258a3dbbe924c4b86853ad3" title="Like poke(), but modifies a single byte. Less efficient, but sometimes you really do just want to mod...">pokeb</a>(<a class="code" href="group__macros.html#gafef9199621fafa1bd046611921ab061f">offsetof</a>(_SYSVideoRAM, <a class="code" href="struct_sifteo_1_1_video_buffer.html#a55592ef6b768dae50b4dbc8a64994ac5" title="Retrieve the last video mode set by setMode()">mode</a>), m);</div>
<div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;    }</div>
<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;</div>
<div class="line"><a name="l00474"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a55592ef6b768dae50b4dbc8a64994ac5">  474</a></span>&#160;    <a class="code" href="group__video.html#ga2e2ba8d4e602cffb8a6e9fc283b18b2f" title="Supported video modes.">VideoMode</a> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a55592ef6b768dae50b4dbc8a64994ac5" title="Retrieve the last video mode set by setMode()">mode</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group__video.html#ga2e2ba8d4e602cffb8a6e9fc283b18b2f" title="Supported video modes.">VideoMode</a>(<a class="code" href="struct_sifteo_1_1_video_buffer.html#a97bdd2f4e61c319f7ddb1479032e36ec" title="Read one byte of VRAM.">peekb</a>(<a class="code" href="group__macros.html#gafef9199621fafa1bd046611921ab061f">offsetof</a>(_SYSVideoRAM, <a class="code" href="struct_sifteo_1_1_video_buffer.html#a55592ef6b768dae50b4dbc8a64994ac5" title="Retrieve the last video mode set by setMode()">mode</a>)));</div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;    }</div>
<div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;    </div>
<div class="line"><a name="l00485"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a5d104afc7ecfd651cbde68d8acb24320">  485</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a5d104afc7ecfd651cbde68d8acb24320" title="Zero all mode-specific video memory.">erase</a>() {</div>
<div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;        _SYS_vbuf_fill(*<span class="keyword">this</span>, 0, 0, _SYS_VA_FIRST_LINE / 2);</div>
<div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;    }</div>
<div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;</div>
<div class="line"><a name="l00508"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#ae61998e02aa120b503bd827490d58dfd">  508</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#ae61998e02aa120b503bd827490d58dfd" title="Initialize the video buffer and change modes.">initMode</a>(<a class="code" href="group__video.html#ga2e2ba8d4e602cffb8a6e9fc283b18b2f" title="Supported video modes.">VideoMode</a> m, <span class="keywordtype">unsigned</span> firstLine = 0, <span class="keywordtype">unsigned</span> numLines = LCD_height) {</div>
<div class="line"><a name="l00509"></a><span class="lineno">  509</span>&#160;        _SYS_finish();</div>
<div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;        <a class="code" href="struct_sifteo_1_1_video_buffer.html#a5d104afc7ecfd651cbde68d8acb24320" title="Zero all mode-specific video memory.">erase</a>();</div>
<div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;        <a class="code" href="struct_sifteo_1_1_video_buffer.html#a0c89222691487b3fc7940d85012cb01f" title="Change the current drawing window.">setWindow</a>(firstLine, numLines);</div>
<div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;        <a class="code" href="struct_sifteo_1_1_video_buffer.html#a6b37adf80404991354f3b7a1be669000" title="Set the display rotation to use in subsequent rendering.">setRotation</a>(ROT_NORMAL);</div>
<div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;        <a class="code" href="struct_sifteo_1_1_video_buffer.html#a41d12aea8d7bf621e92efcfe4a622c0f" title="Change the video mode.">setMode</a>(m);</div>
<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;    }</div>
<div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;</div>
<div class="line"><a name="l00537"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a0692f60195f9dede57413e993bfabce7">  537</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a0692f60195f9dede57413e993bfabce7" title="Attach this VideoBuffer to a cube.">attach</a>(_SYSCubeID <span class="keywordtype">id</span>) {</div>
<div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160;        _SYS_finish();</div>
<div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160;        sys.cube = id;</div>
<div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;        _SYS_vbuf_init(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;        _SYS_setVideoBuffer(*<span class="keyword">this</span>, *<span class="keyword">this</span>);</div>
<div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;    }</div>
<div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;</div>
<div class="line"><a name="l00554"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#ae9c728fc74191f881c5cd3779487de13">  554</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#ae9c728fc74191f881c5cd3779487de13" title="Prepare to modify a particular address.">lock</a>(uint16_t addr) {</div>
<div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;        _SYS_vbuf_lock(*<span class="keyword">this</span>, addr);</div>
<div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;    }</div>
<div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;</div>
<div class="line"><a name="l00565"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a5b6ffc064efbf5e7f9c55bb60698c2df">  565</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a5b6ffc064efbf5e7f9c55bb60698c2df" title="End a sequence of modifications to VRAM.">unlock</a>() {</div>
<div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160;        _SYS_vbuf_unlock(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;    }</div>
<div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;</div>
<div class="line"><a name="l00576"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a7be46f97b775c5e765302f3ac02c7b40">  576</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a7be46f97b775c5e765302f3ac02c7b40" title="Mark the VideoBuffer as having changed, without actually modifying any memory.">touch</a>() {</div>
<div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;        <a class="code" href="struct_sifteo_1_1_video_buffer.html#ae9c728fc74191f881c5cd3779487de13" title="Prepare to modify a particular address.">lock</a>(_SYS_VA_FLAGS);</div>
<div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;    }</div>
<div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;</div>
<div class="line"><a name="l00587"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a4419fb1a7322a4a771ab9a3f2a1d5ca1">  587</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a4419fb1a7322a4a771ab9a3f2a1d5ca1" title="Modify a word of VRAM, automatically locking it and marking the change only if that word has actually...">poke</a>(uint16_t addr, uint16_t word) {</div>
<div class="line"><a name="l00588"></a><span class="lineno">  588</span>&#160;        _SYS_vbuf_poke(*<span class="keyword">this</span>, addr, word);</div>
<div class="line"><a name="l00589"></a><span class="lineno">  589</span>&#160;    }</div>
<div class="line"><a name="l00590"></a><span class="lineno">  590</span>&#160;</div>
<div class="line"><a name="l00595"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a21e9698e8258a3dbbe924c4b86853ad3">  595</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a21e9698e8258a3dbbe924c4b86853ad3" title="Like poke(), but modifies a single byte. Less efficient, but sometimes you really do just want to mod...">pokeb</a>(uint16_t addr, uint8_t byte) {</div>
<div class="line"><a name="l00596"></a><span class="lineno">  596</span>&#160;        _SYS_vbuf_pokeb(*<span class="keyword">this</span>, addr, byte);</div>
<div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;    }</div>
<div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;</div>
<div class="line"><a name="l00602"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a253102bfa4c6b19a043e2698cfeb3049">  602</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#a253102bfa4c6b19a043e2698cfeb3049" title="Poke a 14-bit tile index into a particular VRAM word.">pokei</a>(uint16_t addr, uint16_t index) {</div>
<div class="line"><a name="l00603"></a><span class="lineno">  603</span>&#160;        _SYS_vbuf_poke(*<span class="keyword">this</span>, addr, _SYS_TILE77(index));</div>
<div class="line"><a name="l00604"></a><span class="lineno">  604</span>&#160;    }</div>
<div class="line"><a name="l00605"></a><span class="lineno">  605</span>&#160;</div>
<div class="line"><a name="l00610"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#ab3c23e1d8eefdde108d281ec19aebfe3">  610</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="struct_sifteo_1_1_video_buffer.html#ab3c23e1d8eefdde108d281ec19aebfe3" title="Like pokeb(), but atomically XORs a value with the byte. This is a no-op if and only if byte==0...">xorb</a>(uint16_t addr, uint8_t byte) {</div>
<div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160;        _SYS_vbuf_xorb(*<span class="keyword">this</span>, addr, byte);</div>
<div class="line"><a name="l00612"></a><span class="lineno">  612</span>&#160;    }</div>
<div class="line"><a name="l00613"></a><span class="lineno">  613</span>&#160;</div>
<div class="line"><a name="l00617"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a1951c99493672feefd158034b9b83b29">  617</a></span>&#160;    uint16_t <a class="code" href="struct_sifteo_1_1_video_buffer.html#a1951c99493672feefd158034b9b83b29" title="Read one word of VRAM.">peek</a>(uint16_t addr)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00618"></a><span class="lineno">  618</span>&#160;        <span class="keywordflow">return</span> _SYS_vbuf_peek(*<span class="keyword">this</span>, addr);</div>
<div class="line"><a name="l00619"></a><span class="lineno">  619</span>&#160;    }</div>
<div class="line"><a name="l00620"></a><span class="lineno">  620</span>&#160;</div>
<div class="line"><a name="l00624"></a><span class="lineno"><a class="code" href="struct_sifteo_1_1_video_buffer.html#a97bdd2f4e61c319f7ddb1479032e36ec">  624</a></span>&#160;    uint8_t <a class="code" href="struct_sifteo_1_1_video_buffer.html#a97bdd2f4e61c319f7ddb1479032e36ec" title="Read one byte of VRAM.">peekb</a>(uint16_t addr)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00625"></a><span class="lineno">  625</span>&#160;        <span class="keywordflow">return</span> _SYS_vbuf_peekb(*<span class="keyword">this</span>, addr);</div>
<div class="line"><a name="l00626"></a><span class="lineno">  626</span>&#160;    }</div>
<div class="line"><a name="l00627"></a><span class="lineno">  627</span>&#160;};</div>
<div class="line"><a name="l00628"></a><span class="lineno">  628</span>&#160;</div>
<div class="line"><a name="l00633"></a><span class="lineno">  633</span>&#160;};  <span class="comment">// namespace Sifteo</span></div>
</div><!-- fragment --></div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
    <hr class="footer"/>
    <address class="footer">
        <p><a href="http://sifteo.com">Sifteo</a> SDK v1.0.0 <small>(see <a href="https://developers.sifteo.com/sifteosdk">all versions</a>)</small></p>
        <p>Last updated Wed Mar 27 2013, by <a href="http://www.stack.nl/~dimitri/doxygen">Doxygen</a></p>
    </address>
</body>
</html>
